<template>
	<view>
		<view class="cont">
			<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png" v-if="list.length ===0"></u-empty>
			<view class="" v-else>
				<view class="box" @tap="goinformation(item)" v-for="(item, index) in list" :key="index">
					<view class="box-one">
						<view class="box-title"> {{ item.name }}-{{ obj[item.type] }} </view>
						<view class="box-icon">
							<u-icon name="arrow-right"></u-icon>
						</view>
					</view>
					<view class="box-two">
						<view class="box-two-left">
							<img src="../../../static/image/Frame 880.png" alt="" />申请人：{{
                item.sqr
              }}
						</view>
						<view class="box-two-right"> {{ item.sqsjmc }} </view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import * as api from "@/api/gasTest";
	export default {
		data() {
			return {
				num: 1,
				params: {},
				list: [],
				content: "是否确定开始监护",
				obj: {
					1: "动火作业",
					2: "高空作业",
				},
			};
		},
		methods: {
			goinformation(item) {
				let _that = this
				this.params = item;
				uni.showModal({
					title: "作业监护",
					content: "确定要开始监护吗？",
					success: function(res) {
						if (res.confirm) {
							_that.goTo()
						} else if (res.cancel) {
							console.log('用户选择了取消');
						}
					}
				})
			},
			goTo() {
				uni.navigateTo({
					url: "../information/information?params=" +
						encodeURIComponent(JSON.stringify(this.params)),
				});
			},
			getList() {
				api.getTickList().then((res) => {
					this.list = res.data;
				});
			},
		},
		onShow() {
			this.getList();
		},
	};
</script>

<style lang="scss">
	.avtive {
		background: #1989fa !important;
	}

	.color {
		color: #1989fa !important;
	}

	.tabs {
		display: flex;
		justify-content: space-around;

		.tabs-one {
			width: 311rpx;
			height: 82rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			.tabs-top {
				width: 112rpx;
				height: 44rpx;
				font-size: 28rpx;
				font-family: PingFang SC-Medium, PingFang SC;
				font-weight: 500;
				color: #999;
				line-height: 44rpx;
			}

			.tabs-color {
				width: 64rpx;
				height: 6rpx;
				margin-top: 15rpx;
				background: #fff;
			}
		}
	}

	.cont {
		height: calc(100vh - 120rpx);
		padding: 40rpx 24rpx 0 24rpx;
		background-color: #f6f6f6;

		.box {
			padding: 32rpx 48rpx;
			background-color: #fff;
			border-radius: 16px 16px 16px 16px;
			margin-bottom: 20rpx;

			.box-one {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding-bottom: 20rpx;
				margin-bottom: 20rpx;
				border-bottom: 1px solid #eeeeee;

				.box-title {
					font-size: 32rpx;
					font-family: PingFang SC-Medium, PingFang SC;
					font-weight: 500;
					color: #333333;
				}

				.box-icon {}
			}

			.box-two {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 20rpx;
				border-radius: 8px 8px 8px 8px;
				background: #f6f6f6;

				.box-two-left {
					display: flex;
					align-items: center;

					img {
						width: 28rpx;
						height: 28rpx;
					}

					font-size: 24rpx;
					font-family: PingFang SC-Medium,
					PingFang SC;
					font-weight: 500;
					color: #999999;
				}

				.box-two-right {
					font-size: 24rpx;
					font-family: PingFang SC-Medium, PingFang SC;
					font-weight: 500;
					color: #999999;
				}
			}
		}
	}
</style>
